/*
 * Copyright (C) 2005-2024 Giorgio Maone <https://maone.net>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
@import url(../common/themes.css);

body {
  background-color: var(--bg-color2);
  color: var(--text-color);
  font-size: 12px;
  font-family: system-ui, sans-serif;
}

html.tor:not(.mobile) > body {
  /* Tor Browser may fallback to a serif system-ui font, which is ugly */
  font-family: sans-serif;
}

html.mobile > body {
  font-family: Inter, sans-serif;
  font-size: 4mm;
}

html.mobile .desktop {
  display: none !important;
}

html:not(.tor) .tor, html.tor .not-tor {
  display: none;
}
html.tor .tor, html:not(.tor) .not-tor {
  display: initial;
}

a, a:visited {
  color: var(--accent-color);
}

button, .button {
  appearance: none;
  background: var(--form-color1);
  border: 1px solid var(--fg-color1);
  border-radius: .5em;
  color: var(--text-color);
  font-weight: bold;
  padding: .6em;
  cursor: pointer;
  text-decoration: none;
}

input[type="text"], textarea, select {
  color: var(--text-color);
  background-color: var(--bg-color2);
  border: 1px solid var(--fg-color1);
  border-radius: .4em;
  padding: 0.5em;
  margin: 0.5em;
}

input[type="checkbox"]:not(.https-only, .temp, .reveal) {
  -webkit-appearance: none;
  appearance: none;
  margin: .4em;
  font: inherit;
  color: currentColor;
  width: 1.2em;
  height: 1.2em;
  min-width: 1.2em;
  border: 0.15em solid currentColor;
  border-radius: 0.3em;
  transform: translateY(-0.075em);
  display: grid;
  place-content: center;
  background-color: var(--form-color1);
}

input[type="checkbox"]:not(.https-only, .temp, .reveal)::before {
  content: "";
  width: 0.7em;
  height: 0.7em;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transform-origin: bottom left;
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--form-check-color);

}
input[type="checkbox"]:not(.https-only, .temp, .reveal):checked::before {
  transform: scale(1);
}
input[type="checkbox"]:not(.https-only, .temp, .reveal):checked {
  background-color: var(--form-check-bg-color);
  border-color: var(--form-check-bg-color);
 }

input[type="radio"]:not(.preset) {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--form-color1);
  margin: .4em;

  font: inherit;
  color: currentColor;
  width: 1.2em;
  height: 1.2em;
  min-width: 1.2em;

  border: 0.15em solid currentColor;
  border-radius: 50%;
  transform: translateY(-0.075em);
  display: grid;
  place-content: center;
}

input[type="radio"]:not(.preset)::before {
  content: "";
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--form-radio-color);
  background-color: CanvasText;
}

input[type="radio"]:not(.preset):checked::before {
  transform: scale(1);
}
input[type="radio"]:not(.preset):checked {
  background-color: var(--form-radio-bg-color);
}


input:disabled, button:disabled, select:disabled {
  filter: grayscale(100%) contrast(33%) !important;
  opacity: .7;
}

:disabled {
  cursor: not-allowed !important;
}

:focus-visible, :is(.cap.needed, .switch):focus-within {
  outline: 0;
  filter:
    drop-shadow(1px 1px 1px var(--focus-color))
    drop-shadow(-1px -1px 1px var(--focus-color))
    drop-shadow(1px -1px 1px var(--focus-color))
    drop-shadow(-1px -1px 1px var(--focus-color)) !important;
}

:is(label, .full-address, .full-address *):is(:focus, :focus-visible) {
  text-shadow: 0 0 .1em var(--focus-color);
  filter: none !important;
}

.donate {
  color: var(--text-color1) !important;
  border-color: transparent;
  background-color: transparent;
  transform: scale(1.2);
  transition: all .5s ease-in-out;
  text-transform: uppercase;
}

.donate:hover {
  transform: scale(1.8);
  text-shadow: var(--bg-color2) 1px 1px 3px, -1px -1px 3px, -1px 0 3px, 1px 0 3px;
}

.donate:before {
  content: "♥";
  color: var(--accent-color);
  padding: 0 .2em 0 .5em;
  text-shadow: 0.04em 0.04em 0.04em #0004;
}
